<?php

namespace api\modules\wechat\controllers;

use common\models\Tool;
use common\sdks\Wechat;
use common\services\reply\WechatAutoReply;
use yii\web\BadRequestHttpException;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii;

/**
 * Default controller for the `wechat` module
 */
class ReceiveController extends Controller
{

    public function actionIndex()
    {echo 444;die;
        $weObj = Yii::$app->wechat;
        $weObj->valid();
        file_put_contents('/tmp/weixin_rec.log', print_r($weObj->getRev()->getRevData(), true), FILE_APPEND);
        $wx_reply = new WechatAutoReply($weObj);
        $wx_reply->reply();
    }
}
